package com.atguigu.factory.absfactory.order;

import com.atguigu.factory.absfactory.pizza.LDCheesePizza;
import com.atguigu.factory.absfactory.pizza.LDGreekPizza;
import com.atguigu.factory.absfactory.pizza.Pizza;

/**
 * @author LYJ
 * @Description
 * @date 2021 年 09 月 10 日 上午10:42
 */
public class LDFactory implements AbsFactory {

    @Override
    public Pizza createFactory(String orderType) {
        if ("Cheese".equals(orderType)) {
            LDCheesePizza ldCheesePizza = new LDCheesePizza();
            ldCheesePizza.setName("伦敦CheesePizza");
            return ldCheesePizza;
        } else if ("Greek".equals(orderType)) {
            LDGreekPizza ldGreekPizza = new LDGreekPizza();
            ldGreekPizza.setName("北京GreekPizza");
            return ldGreekPizza;
        }
        return null;
    }
}
